#!/bin/sh

set -ex

export DEBIAN_FRONTEND=noninteractive
#apt-get -y update
apt-get -y install openjdk-7-jdk
apt-get -y clean

rm -rf /opt/gradle*
unzip -q /vagrant/tools/gradle-1.10-bin.zip -d /opt
cat << 'EOF' > /etc/profile.d/gradle.sh
export PATH=$PATH:/opt/gradle-1.10/bin
EOF

rm -rf /opt/grails*
unzip -q /vagrant/tools/grails-2.3.6.zip -d /opt
cat << 'EOF' > /etc/profile.d/grails.sh
export PATH=$PATH:/opt/grails-2.3.6/bin
EOF

cat << 'EOF' > /etc/profile.d/java.sh
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
EOF

cp /vagrant/dev-files/default/red5 /etc/default
